<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('工单表列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>创建人：</label>
                            <input type="text" name="createUser"/>
                        </li>
                        <li>
                            <label>持有者：</label>
                            <input type="text" name="holdUser"/>
                        </li>
                        <li>
                            <label>工单状态：</label>
                            <select name="workStatus">
                                <option value="">请选择</option>
                                <option value="0">新工单</option>
                                <option value="1">已处理</option>
                            </select>
                        </li>
                        <!--<li>
                            <label>完成描述：</label>
                            <input type="text" name="completeDescription"/>
                        </li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!--<div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" href="/system/customer" shiro:hasPermission="system:form:add">
            <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:form:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:form:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:form:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>-->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    var editFlag = [[${@permission.hasPermi('system:form:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:form:remove')}]];
    var prefix = ctx + "system/finishForm";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "工单表",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'createUser',
                    title: '创建人'
                },
                {
                    field: 'holdUser',
                    title: '持有者'
                },
                {
                    field: 'custName',
                    title: '顾客姓名'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'workStatus',
                    title: '工单状态',
                    formatter: function (value) {
                        if (value == '0' ){
                            return '<div >新工单审核</div>'
                        }else {
                            return '<div >已处理</div>'
                        }
                    }
                },
                {
                    field: 'faultDescription',
                    title: '故障描述'
                },
                {
                    field: 'faultPhotoAddress',
                    title: '故障照片'
                },
                {
                    field: 'completeDescription',
                    title: '完成描述'
                },
                {
                    field: 'finishPhotoAddress',
                    title: '完成照片'
                }]
        };
        $.table.init(options);
    });
    function submitHandler() {
        $.modal.refresh()
    }
</script>
</body>
</html>
